package ch.drshit.view.swing;

import javax.swing.JMenu;
import javax.swing.JMenuBar;
import javax.swing.JMenuItem;

public class MyJMenuBar extends JMenuBar{
	public static final String FILE = "File";
	//
	public static final String FILE_OPEN = "Open";
	public static final String FILE_SAVE = "Save";
	public static final String FILE_UNDO = "Undo";
	public static final String FILE_REDO = "Redo";
	//
	//
	public static final String BASIC = "Basic";
	//
	public static final String BASIC_GREY = "Grey";
	public static final String BASIC_HOCHPASS = "Hochpass";
	
	private static final long serialVersionUID = 8089247780329259805L;

	public MyJMenuBar(){
		String[] sMenu = 
			{FILE,BASIC};
		
		String[][] sMenuItem = {
				{FILE_OPEN,FILE_SAVE,FILE_UNDO,FILE_REDO},
				{BASIC_GREY,BASIC_HOCHPASS}
		};
		
		for(int i=0;i<sMenu.length;i++){
			JMenu jmenu = new JMenu(sMenu[i]);
			jmenu.setName(String.valueOf(i));
			for(int r=0;r<sMenuItem[i].length;r++){
				JMenuItem jmenuitem = new JMenuItem(sMenuItem[i][r]);
				jmenu.add(jmenuitem);
				jmenuitem.setName(i + sMenuItem[i][r]);
			}
			this.add(jmenu);
		}
	}
}
